#ifndef __MOCK_H__
#define __MOCK_H__

#include <gmock/gmock.h>
#include <cstdint>
#include <openssl/types.h>

#include "object_base.h"

#ifdef __cplusplus
extern "C" {
#endif

class HcfMock final {
public:
    MOCK_METHOD(void *, HcfMalloc, (uint32_t, char));
    MOCK_METHOD(int, OpensslEvpMdCtxSize, (const EVP_MD_CTX *));
    MOCK_METHOD(bool, HcfIsClassMatch, (const HcfObjectBase *, const char *));
    MOCK_METHOD(bool, HcfIsStrValid, (const char *, uint32_t));
    MOCK_METHOD(int, OpensslEvpDigestInitEx, (EVP_MD_CTX *, const EVP_MD *, ENGINE *));
};

extern HcfMock* g_mock;
void SetMock(HcfMock* mock);
void ResetMock(void);

void *__real_HcfMalloc(uint32_t size, char val);
int __real_OpensslEvpMdCtxSize(const EVP_MD_CTX *ctx);
bool __real_HcfIsClassMatch(const HcfObjectBase *obj, const char *className);
bool __real_HcfIsStrValid(const char *str, uint32_t maxLen);
int __real_OpensslEvpDigestInitEx(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl);

#ifdef __cplusplus
} /* extern "C" */
#endif

#endif /* __MOCK_H__ */
